From 438c66d913837ab3c78edce96e96a01106057a24 Mon Sep 17 00:00:00 2001
From: "C. Scott Ananian" A B
+!! html/php
+
A B
C[edit]
!! html/parsoid
-A B
+
A B
C
!! end
@@ -4851,8 +4855,8 @@ parsoid=wt2html,wt2wt
#Is this great? +Foo#Is this great? +meatball:Foo#Is this great? +
+!! html/parsoid +#Is this great? +Foo#Is this great? +meatball:Foo#Is this great?
+!! end + +!! test +Link scenarios with escaped fragments (legacy) +!! config +wgFragmentMode=[ 'legacy' ] !! wikitext [[#Is this great?]] [[Foo#Is this great?]] @@ -8683,10 +8737,6 @@ Link scenarios with escaped fragments Foo#Is this great? meatball:Foo#Is this great? -!! html/parsoid -#Is this great? -Foo#Is this great? -meatball:Foo#Is this great?
!! end # Ideally the wikipedia: prefix here should be proto-relative too @@ -8711,19 +8761,19 @@ Different interwiki prefixes mapping to the same URL [[ wikiPEdia :Foo]] !! html/parsoid - + - + - + - + - + - + - + !! end !! test @@ -8743,9 +8793,9 @@ Interwiki links that cannot be represented in wiki syntax is just fragment !! html/parsoid -meatball:ok -ok with fragment -ok ending with ? mark +
meatball:ok +ok with fragment +ok ending with ? mark has query is just fragment
!! end @@ -8758,7 +8808,7 @@ Interwiki links: trail !! html/parsoid - + !! end !! test @@ -8812,7 +8862,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end !! test @@ -8910,8 +8960,8 @@ Blah blah blah !! html/parsoidBlah blah blah -es:Spanish - zh : Chinese
+es:Spanish + zh : Chinese !! end !! test @@ -8928,7 +8978,7 @@ parsoid=wt2html [[:::es:Spanish]] !! html/parsoid -es:Spanish [[::es:Spanish]] [[:::es:Spanish]]
!! end @@ -9005,7 +9055,7 @@ parsoid=wt2html,wt2wt,html2html Blah blah blah [[zh:Chinese]] !! html/parsoid -Blah blah blah zh:Chinese
+Blah blah blah zh:Chinese
!! end ## PHP parser tests script needs an update @@ -9019,7 +9069,7 @@ parsoid=wt2html,wt2wt,html2html Blah blah blah [[zh:Chinese]] !! html/parsoid -Blah blah blah zh:Chinese
+Blah blah blah zh:Chinese
!! end !! test @@ -9106,7 +9156,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end @@ -9134,7 +9184,7 @@ Blah blah blah !! html/parsoidBlah blah blah -local:es:Spanish
+local:es:Spanish !! end !! test @@ -9177,10 +9227,12 @@ Blah blah blah # This tests the Parsoid bail-out code. !! test 3. Other redirect variants +!! options +parsoid=wt2html !! wikitext #REDIRECT [[some
1
-2
-3
-4
-5
-6
!! html/parsoid - -1
-2
-3
-4
-5
-6
!! end @@ -14264,15 +14317,15 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end !! test -Serialize simple image with figure-inline wrapper +Serialize simple image with span wrapper !! options parsoid=html2wt !! html/parsoid - + !! wikitext [[File:Foobar.jpg]] !! end @@ -14285,7 +14338,7 @@ Simple image (using File: namespace, now canonical) !! html/parsoid - + !! end !! test @@ -14402,7 +14455,7 @@ Linktrails should not work for images: [[File:Foobar.jpg]]sLinktrails should not work for images: s
!! html/parsoid -Linktrails should not work for images: s
+Linktrails should not work for images:
456
!! html/parsoid - +123
456
123
456
!! end @@ -14516,7 +14569,7 @@ Image with multiple widths -- use last !! html/parsoid - + !! end !! test @@ -14533,7 +14586,7 @@ thumbsize=220 !! html/parsoid - + !! end !! test @@ -14566,7 +14619,7 @@ parsoid=wt2html,wt2wt,html2html !! html/parsoid - + !! end !! test @@ -14577,7 +14630,7 @@ Image with link parameter, wiki target !! html/parsoid - + !! end # parsoid T51293 (part 1) @@ -14589,7 +14642,7 @@ Image with link parameter, URL target !! html/parsoid - + !! end # parsoid T51293 (part 2) @@ -14601,7 +14654,7 @@ Image with link parameter, protocol-less URL target !! html/parsoid - + !! end !! test @@ -14673,7 +14726,7 @@ Image with empty link parameter!! html/parsoid -
+
a | b |
c |
The line above must have a trailing space!
But just in case it doesn't...
+!! html/parsoid +The line above must have a trailing space!
+But just in case it doesn't...
!! end !! test @@ -16902,7 +16978,7 @@ section 4 == text " text == section 5 -!! html +!! html/phpThe tooltips shall not show entities to the user (ie. be double escaped)
section 5
+!! html/parsoid +The tooltips shall not show entities to the user (ie. be double escaped)
+ +section 1
+ +section 2
+ +section 3
+ +section 4
+ +section 5
!! end !! test @@ -16961,7 +17054,7 @@ section 6 [[#Plus-Entity+between+Text]] [[#Underscore_between_Text]] [[#Underscore-Entity_between_Text]] -!! html +!! html/phpId should not contain + for spaces
Id should not contain + for spaces
+ +section 1
+ +section 2
+ +section 3
+ +section 4
+ +section 5
+ +section 6
+ +#Space between Text +#Space-Entity between Text +#Plus+between+Text +#Plus-Entity+between+Text +#Underscore_between_Text +#Underscore-Entity_between_Text
!! end +# Parsoid html2wt disabled because it adds padding spaces around = !! test Headers with excess '=' characters (Are similar tests necessary beyond the 1st level?) +!! options +parsoid=wt2html,wt2wt,html2html !! wikitext =foo== ==foo= =''italic'' heading== ==''italic'' heading= -!! html +!! html/phpbytebacklink +
bytebacklink
!! html/parsoid -bytebacklink
+bytebacklink
+!! end + +!! test +Sanitizer: Escaping of spaces, multibyte characters, colons & other stuff in id="" (legacy) +!! config +wgFragmentMode=[ 'legacy' ] +!! wikitext +byte[[#æ: v|backlink]] +!! html/php +bytebacklink +
!! end # In HTML5, the restrictions are that id must contain at least one character, @@ -18516,6 +18679,37 @@ parsoid=wt2html,wt2wt2013
!! end +!! test +Sanitizer: Avoid unnecessary percent encoded characters in interwiki links +!! wikitext +[[meatball:Soft"Security]] +!! html/php + +!! html/parsoid + +!! end + +!! test +Sanitizer: angle brackets are invalid, even in interwiki links (T182338) +!! wikitext +[[meatball:Foo[[meatball:Foo<Bar]] +[[meatball:Foo>Bar]] +[[meatball:Foo<bar]] +[[meatball:Foo>bar]] +
+!! html/parsoid +[[meatball:Foo<Bar]] +[[meatball:Foo>Bar]] +[[meatball:Foo<bar]] +[[meatball:Foo>bar]]
+!! end + !! test Language converter: output gets cut off unexpectedly (T7757) !! options @@ -18877,12 +19071,15 @@ Fuzz testing: Parser13 !! end +# Note that Parsoid output differs from the PHP parser here: the PHP +# parser breaks the URL for the magic word, while in Parsoid the URL +# production takes precedence. !! test Fuzz testing: Parser14 !! wikitext == onmouseover= == http://__TOC__ -!! html +!! html/phphttp://
foo_bar©#%n +
+!! html/parsoid +foo_bar©#%n
+!! end + +!! test +anchorencode (legacy) +!! config +wgFragmentMode=[ 'legacy' ] +!! wikitext +{{anchorencode:foo bar©#%n}} +!! html/phpfoo_bar.C2.A9.23.25n
!! end !! test anchorencode trims spaces +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext {{anchorencode: __pretty__please__}} -!! html +!! html/phppretty_please
+!! html/parsoid +pretty_please
!! end !! test anchorencode deals with links +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext {{anchorencode: [[hello|world]] [[hi]]}} -!! html +!! html/phpworld_hi
+!! html/parsoid +world_hi
!! end !! test anchorencode deals with templates +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! wikitext -{{anchorencode: {{Foo}} }} -!! html -FOO +{{anchorencode: {{Foo}} x}} +!! html/php +
FOO_x
+!! html/parsoid +FOO_x
!! end !! test anchorencode encodes like the TOC generator: (T20431) +!! config +wgFragmentMode=[ 'html5', 'legacy' ] +!! wikitext +=== _ +:.3A%3A _ &&]] x === +{{anchorencode: _ +:.3A%3A _ &&]] x}} +__NOEDITSECTION__ +!! html/php ++:.3A%3A_&&]]_x +
+!! html/parsoid ++:.3A%3A_&&]]_x
+ +!! end + +!! test +anchorencode encodes like the TOC generator: (T20431) (legacy) +!! config +wgFragmentMode=[ 'legacy' ] !! wikitext === _ +:.3A%3A&&]] === {{anchorencode: _ +:.3A%3A&&]] }} __NOEDITSECTION__ -!! html +!! html/php.2B:.3A.253A.26.26.5D.5D
@@ -21794,6 +22071,8 @@ language=sr variant=sr-ec !! test -{}- tags within headlines (within html for parserConvert()) +!! config +wgFragmentMode=[ 'html5', 'legacy' ] !! options language=sr variant=sr-ec !! wikitext @@ -21804,14 +22083,14 @@ conversion: == Latinski == !! html/php -ÐоÑе ÑÑ Ð°Ñ ÐµÐ²ÐµÐ½ ан ÑнпÑоÑеÑÑед Ñ ÐµÐ°Ð´Ð»Ð¸Ð½Ðµ ÐÐ Ð¸Ñ Ð½Ð¾Ñ Ð°ÑÑеÑÑед бy лангÑаге ÑонвеÑÑион:
Note that even an unprotected headline ID is not affected by language conversion:
@@ -22624,15 +22903,9 @@ File:foobar.jpg|{{Test|unamedParam|alt=-{R|param}-}}|alt=galleryaltUser:+% Page+title%
%+ %20 %+ %+r
-% +
+% +
[edit]
!! html/parsoid -Quote
Quote
Hanc marginis exiguitas non caperet. QED
!! html/parsoid -Hanc marginis exiguitas non caperet. QED
!! end @@ -24126,8 +24401,9 @@ __TOC__[edit]
!! html/parsoid -Bar
Bar
xy
+!! html/parsoid +xy
!! end !! test @@ -24851,16 +25129,59 @@ Headings: 4b. No escaping needed (inside p-tags) !! options parsoid=html2wt !! html/parsoid -=== -=foo= x +
=foo= x
=foo=
=foo= x
+=foo=
+
=== +
+!! wikitext +=== +
+!! end + +# in the html2wt direction we emit '= = =' or '== +== +
+= +==
++
hiho
!! end +!! test +Catch regression when unpacking with trailing content +!! wikitext +{{echo|FooFoo
bar
+!! end + !! test Use data-parsoid.firstWikitextNode to compute newline constraints for template content !! options @@ -29535,6 +29864,24 @@ wgRawHtml=1 !! test Decoding of HTML entities in headings and links for IDs and link fragments (T103714) +!! config +wgFragmentMode=[ 'html5', 'legacy' ] +!! wikitext +== A&B&C&D&amp;E == +[[#A&B&C&D&amp;E]] +!! html/php +x |
x |
x |
+!! end + +# this version of the test strips out the ambiguity so Parsoid rts cleanly +!! test +Decoding of HTML entities in indicator names for IDs (unambiguous) (T104196) +!! options +showindicators +!! wikitext +
!! end +# This fragment mode is what Parsoid supports. !! test HTML5 ids: fallback to legacy !! config @@ -29600,8 +29976,27 @@ wgFragmentMode=[ 'html5', 'legacy' ]
ð©
+!! html/parsoid +#Foo bar #foo Bar #ТеÑÑ #ÑеÑÑ #Hey < # " > % : '
+ +ð©
+ + + !! end +# Parsoid doesn't support this mode !! test HTML5 ids: legacy with a fallback to modern !! config @@ -29649,6 +30044,7 @@ wgFragmentMode=[ 'legacy', 'html5' ] !! end +# Parsoid doesn't support this mode. !! test HTML5 ids: no legacy !! config @@ -29720,6 +30116,9 @@ T51672: Test for brackets in attributes of elements in external link texts +!! html/parsoid + !! end !! test @@ -29732,6 +30131,9 @@ T72875: Test for brackets in attributes of elements in internal link texts +!! html/parsoid + !! end !! test @@ -29743,6 +30145,8 @@ wgFragmentMode=[ 'html5' ] !! html/php +!! html/parsoid + !! end ## ------------------------------ @@ -29773,7 +30177,7 @@ e = 3 = f !! html/parsoid -a
a
a
a
x
@@ -29942,6 +30346,7 @@ e # Because of section-wrapping and template-wrapping interactions, # the scope of the template is expanded so that the template markup # is valid in the presence ofa
+ + +b +
+ +c
+a
a
a
+ +b